/*
 * Created on 10.06.2004
 */

package de.localsport.util;

import java.sql.Connection;

/**
 * @author MaS
 *
 */

public abstract class MySqlConnector {

	static final String DBDriver  = "com.mysql.jdbc.Driver";
	static final String strConn   = "jdbc:mysql://127.0.0.1/EM2004";
  
	static final String DBusername= "";
	static final String DBpassword= "";

	public static String loadDriver () {
		String sErr = "";
	  	try {
			java.sql.DriverManager.registerDriver((java.sql.Driver)(Class.forName(DBDriver).newInstance()));
	  	}
	  	catch (Exception e) {
			sErr = e.toString();
	  	}
	  	return (sErr);
	}
	
	public static Connection cn() throws java.sql.SQLException {
	  	String sErr = loadDriver();	  
	  	return java.sql.DriverManager.getConnection(strConn , DBusername, DBpassword);
	}

	public static void main(String[] args) {
	}
}
